Skip to content

review-followups: code fixes, perf, docs links, status bar, CI matrix#11

Closed
dmartinochoa wants to merge 2 commits into
mainfrom
review-followups
Closed

review-followups: code fixes, perf, docs links, status bar, CI matrix#11
dmartinochoa wants to merge 2 commits into
mainfrom
review-followups

Conversation

@dmartinochoa
Copy link
Copy Markdown
Member

Summary

Lands the cheap-and-high-value subset of the post-v0.1.1 review pass. Items map to R1–R9 and R21 in ROADMAP.md. The remaining items (suppression CodeActions, next/prev finding nav, scan-on-save, telemetry, the workspace config file, screenshots, etc.) stay queued for follow-up PRs.

What changed

Code fixes

  • R1 Reorder the filterByThreshold import in extension.ts up to the rest of the import block.
  • R2 "Restart language server" toast no longer fires when startClient() failed.
  • R3 `stopClient` races the LSP shutdown against a 2-second timeout; dispose explicitly on timeout. Stops VS Code reporting "Window not responding" on a deadlocked child.
  • R4 `groupByFile` drops the `Uri.parse(key)` round-trip — bucket value carries the original Uri.
  • R5 `compareByLocation` sorts on `fsPath` (was `uri.toString()` which includes the scheme prefix).

Performance

  • R6 `collectFindings()` memoised behind a per-refresh cache. Used to walk the global diagnostic store twice per refresh; now once.
  • R7 `onDidChangeDiagnostics` handler early-outs when the batch's URIs neither carry a pipeline-check diagnostic nor were in the last finding set. ESLint / mypy / redhat.yaml keystroke chatter stops waking up the tree rebuild. The "or were in the last finding set" branch handles clears — a stale leaf can't outlive a cleared file.

UX

  • R8 Leaf tooltip now appends `$(book) RULE documentation` when the server publishes `Diagnostic.code.target`. MarkdownString is `isTrusted = true` so the link is clickable inside a TreeItem tooltip. Closes the marketplace-copy promise of "hover descriptions with `--explain` prose" — there's now a link to the full rule documentation.
  • R9 New status bar item (src/statusBar.ts) on the left at priority 100. Shows `$(shield) 3C 1H` (counts of the top two severities present). Click reveals the Findings panel. Tooltip carries the full breakdown.

CI

  • R21 Test matrix: `[ubuntu-latest, windows-latest, macos-latest]`. `npm audit` and the vsix upload stay pinned to Linux (network-bound / would collide on artefact name). `fail-fast: false` so a Windows-only failure doesn't kill the other two runs.

Test plan

  • `npm run lint` clean
  • `npm run compile` clean (typecheck + esbuild)
  • `npm test` — 53 tests pass (was 37 on main; +13 statusBar + +3 findingsView for the new behavior)
  • `npm run smoke` — bundle loads with vscode stub
  • Manual smoke under F5: open the sample workflow fixture, confirm the Findings panel populates, hover a leaf to see the new docs link, look bottom-left for the status bar item.

Notes

  • The `pipelineCheck.findings.focus` command used by the status bar is auto-generated by VS Code for every registered view ID; no explicit registration needed.
  • `STOP_TIMEOUT_MS = 2000` is conservative; the LSP server's normal shutdown takes <200ms. Bump if it turns out to be too aggressive in the wild.

🤖 Generated with Claude Code

dmartinochoa and others added 2 commits May 19, 2026 10:27
In-depth review queued 29 follow-up items grouped by category: code
fixes, performance, UX gaps, architecture, testing, marketplace, CI,
and strategic. Items already covered elsewhere in this roadmap are not
repeated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Lands the cheap-and-high-value subset of the post-v0.1.1 review pass.

R1 — extension.ts: move the filterByThreshold import up to the rest
of the import block. Was sitting after a function declaration as a
merge artefact.

R2 — extension.ts: "Restart language server" toast no longer fires
when startClient failed. The catch path already surfaces its own
error notification; the success toast now gates on `if (client)`.

R3 — extension.ts: stopClient races local.stop() against a 2-second
timer (STOP_TIMEOUT_MS) and dispose()s the client on timeout. A
deadlocked LSP child used to hold the deactivate path indefinitely
and VS Code reported "Window not responding".

R4 — findingsView.ts: groupByFile drops the Uri.parse round-trip.
Bucket value now carries the original Uri alongside the items array.

R5 — findingsView.ts: compareByLocation sorts on fsPath instead of
the full URI string. Cross-scheme entries (file:// vs untitled://)
no longer bunch at one end of the tree.

R6 — findingsView.ts: collectFindings memoised behind a per-refresh
cache. buildRoot and updateBadge used to walk the workspace
diagnostic store twice per refresh; now both read from the same
walk. cachedFindings is invalidated in refresh().

R7 — findingsView.ts: onDidChangeDiagnostics handler now early-outs
when the batch's URIs neither carry a pipeline-check diagnostic nor
appeared in the last finding set. ESLint / mypy / redhat.yaml
keystroke chatter no longer wakes up the tree rebuild. The
lastFindingUris set carries the URIs we last had findings for so
*clears* are detected too (a stale leaf can't outlive a cleared
file).

R8 — findingsView.ts: leaf tooltip now appends a "$(book) RULE
documentation" link when the server publishes Diagnostic.code.target.
MarkdownString gets isTrusted=true so the link is clickable inside
a TreeItem tooltip. composeLeafTooltip extracted as a function for
unit testing.

R9 — statusBar.ts: new module. Adds a left-side status bar item
showing per-severity counts (e.g. "$(shield) 3C 1H"). Click reveals
the Findings panel via the auto-generated pipelineCheck.findings.focus
command. Updates on every onDidChangeDiagnostics; pure helpers
(formatStatusBarText, formatStatusBarTooltip, countDiagnostics) live
on the module so the tests pin the copy without booting VS Code.

R21 — ci.yml: matrix over [ubuntu-latest, windows-latest,
macos-latest]. npm audit and the vsix upload stay pinned to Linux
(network-bound / would otherwise collide on identical names).
fail-fast: false so a Windows-only failure doesn't kill the macOS
and Linux runs.

Tests:
- findingsView.test.ts: MarkdownString stub gains appendMarkdown /
  isTrusted / supportThemeIcons. getDiagnostics stub handles both
  the zero-arg (all pairs) and uri-arg (just that URI) forms used by
  R7's batch-touches-us check.
- findingsView.test.ts: +3 tests covering R8 (link appended when
  docsUrl present, tooltip clean when absent) and R6 (refresh() picks
  up newly-published diagnostics).
- statusBar.test.ts: new file. 13 tests across formatStatusBarText
  (clean / critical-first / high-pair / collapse-to-total),
  formatStatusBarTooltip (no findings / breakdown / singular), and
  countDiagnostics (source filter / tally / INFO fallback / lowercase
  normalise).

Total: 53 tests pass; lint + smoke clean. Three-OS CI verifies on
each push.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@dmartinochoa has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 33 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9fa7b47-e38c-42c6-8290-5676e9cc7f87

📥 Commits

Reviewing files that changed from the base of the PR and between ffbf0f0 and 937ac83.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • ROADMAP.md
  • src/extension.ts
  • src/findingsView.test.ts
  • src/findingsView.ts
  • src/statusBar.test.ts
  • src/statusBar.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch review-followups

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dmartinochoa
Copy link
Copy Markdown
Member Author

Rolled into #16 (v0.2.0 mega-PR). Every commit from this branch is in #16's history; closing to consolidate the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant